﻿<?xml version="1.0"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
    assembly="JSC.Portal.Core" namespace="JSC.Portal.Entities">

	<class name="Template" table="jsc_template" lazy="false">

		<!-- start Base on every entity -->
		<id name="Id" column="templateid" unsaved-value="-1">
			<generator class="native">
				<param name="sequence">jsc_template_templateid_seq</param>
			</generator>
		</id>

		<property name="Name" column="name" not-null="true"/>
		<property name="Description" column="description"/>
		<!-- end Base on every entity -->

		<property name="ControlName" column="controlname" not-null="true"/>
		<property name="CSS" column="css"/>
		<property name="Path" column="path" not-null="true"/>

		<bag name="Pages" 
         cascade="none" 
         inverse="true" 
         lazy="true" 
         order-by="position">
			<key column="templateid" />
			<one-to-many class="PortalPage"
                   not-found="ignore" />
    </bag>   

	</class>
</hibernate-mapping>